package com.mingzhi.product.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RefreshScope
@RestController
public class NacosController {

    //从 bootstrap.yml 配置文件中获取配置信息
    @Value("${nacos.config}")
    private String nacosConfig;

    //    从nacos中获取服务信息
    @RequestMapping("/getConfig")
    public String getConfig() {
        log.info("从nacos中获取服务信息");
        return "从nacos中获取服务信息 nacos.config:" + nacosConfig;
    }
}
